# -- coding: utf-8 --
# @time : 2023/6/25
# @author : 周梦泽
# @file : taobao_requests_headers.py
# @software: pycharm
# 请求淘宝api通用请求头
# from fake_useragent import UserAgent


def page_headers(page):
    """
    请求淘宝api通用请求头
    """
    cookies = ','.join([f"{key}={value}" for key, value in page.cookies.items()])
    headers = {
<<<<<<< HEAD
<<<<<<< HEAD
        # "User-Agent": UserAgent().random,
        "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
=======
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
>>>>>>> 83ad0cd66287fd67a7fd4f1a06c7b35afd989c71
=======
        # "User-Agent": UserAgent().random,
        "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
>>>>>>> bff4fcb3fb0f3bf6415d8a75b0649359fa32fe62
        "Cookie": cookies,
        "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
        "Referer": "https://subway.simba.taobao.com/index.jsp",
        "Origin": "https://subway.simba.taobao.com"
    }
    return headers
